var url = window.location.href;
var splits = url.split("=")[1];
//SESSION_ID
var session = splits.split("&")[0];
//商铺ID
var agentShopID = url.split("=")[2];
$.post("http://www.brandt-beer.com/app/goods/goodsList",
    {SESSION_ID:session,currentPage:1,TYPE:0},
    function (data) {
    // console.log(data);
    $.each(data.data,function (index , element) {
        var receive =
            '<div class="container" name='+element.GOODS_ID+'>'+
            '<img id="img" src="../../image/u718%5B1%5D.jpg">'+
            '<div class="obtain">'+
            '<div class="title">'+element.GOODS_TITLE+' '+element.GOODS_SUBTITLE+'</div>'+
            '<p style="float: left;font-size: 15px">￥:'+element.UNIT_PRICE+'<p style="font-size: 11px;line-height:20px;color: #cdcdcd;margin-left: 20px;float: left">'+element.SALES_SUM+'人购买'+'</p>'+'</p>'+
            '</div>'+
            '</div>';
        $("#lang").append(receive);
    });
    //吧商品ID写到标签上

    $("#lang div").click(function (that){
        var number = $(this).attr("name");
        console.log(number);
        window.location.href="details/details.html?session="+session+"&goodsID="+number+"&agentShopID="+agentShopID;
    })
});
